(function () {
    "use strict";

    function extractContent(value) {
        var myContainer = document.getElementById('container');
        myContainer.innerHTML = value;

        var onlyText = myContainer.innerText.split('\n').join('');

        myContainer.innerHTML = onlyText;
        console.log(onlyText);
    }

    var input = '<p>Hello</p><a href="http://w3c.org">W3C</a>';
    extractContent(input);
}());